package ecnu.liwaTest.dd.pages;

import org.openqa.selenium.By;
import org.openqa.selenium.Keys;

import javax.xml.crypto.Data;

import static ecnu.liwaTest.dd.DriverSingleton.waitForWindow;
import static org.hamcrest.CoreMatchers.is;
import static org.hamcrest.MatcherAssert.assertThat;

public class DataPage extends BasePage {

    public DataPage goDataPage() {
        driver.findElement(By.cssSelector(".el-menu-item:nth-child(2) > span")).click();
        waitForWindow(1000);
        assertThat(driver.getTitle(), is("咨询记录列表"));
        return this;
    }

//    public DataPage downloadRecord() {
//        waitForWindow(1000);
//        driver.findElement(By.cssSelector(".el-table__row:nth-child(1) .el-button:nth-child(2) > span")).click();
//        waitForWindow(1000);
//        driver.findElement(By.cssSelector(".el-button--small:nth-child(2) > span")).click();
//        driver.findElement(By.cssSelector(".el-table__row:nth-child(1) .el-button:nth-child(1) > span")).click();
//        waitForWindow(1000);
//        System.out.println(driver.findElement(By.cssSelector(".content:nth-child(1)")).getText());
//        waitForWindow(2000);
//        return this;
//    }
//
//    public DataPage batchDownload() {
//        waitForWindow(1000);
//        driver.findElement(By.cssSelector(".el-table__row:nth-child(1) .el-checkbox__input")).click();
//        driver.findElement(By.cssSelector(".el-table__row:nth-child(2) .el-checkbox__input")).click();
//        driver.findElement(By.cssSelector(".el-table__row:nth-child(3) .el-checkbox__input")).click();
//        driver.findElement(By.cssSelector(".customButton > span")).click();
//        waitForWindow(1000);
//        driver.findElement(By.cssSelector(".el-button--small:nth-child(2) > span")).click();
//        waitForWindow(1000);
//        return this;
//    }
//
//    public DataPage batchDownloadFail() {
//        waitForWindow(1000);
//        driver.findElement(By.cssSelector(".customButton > span")).click();
//        return this;
//    }

}
